# ******************************************************
# Variables
DEFS = -Wall -DLINUX
INCLUDES = -I../include

CXX = g++
CXXFLAGS = $(DEFS) $(INCLUDES)

SRC_PATH = 
OBJ_PATH = obj
BIN_PATH = ../lib
LIB_PREFIX = lib
BINARY = $(BIN_PATH)/$(LIB_PREFIX)utils.a
# ******************************************************

help info:
	@echo 'Usage: make {install | clean | help, info }'

install:
	@echo 'Compiling of source files...'
	mkdir -p $(OBJ_PATH)
	$(CXX) $(CXXFLAGS) -c sockets.cpp -o $(OBJ_PATH)/sockets.o
	$(CXX) $(CXXFLAGS) -c tcp_send.cpp -o $(OBJ_PATH)/tcp_send.o
	$(CXX) $(CXXFLAGS) -c tcp_recv.cpp -o $(OBJ_PATH)/tcp_recv.o
	$(CXX) $(CXXFLAGS) -c threads.cpp -o $(OBJ_PATH)/threads.o

	@echo 'Linking of object files...'
	mkdir -p $(BIN_PATH)
	ar rcs $(BINARY) $(OBJ_PATH)/*.o

clean:
	@echo 'Removing temporary files...'
	@rm -rf $(OBJ_PATH) $(BIN_PATH)